<script th:fragment="businessJs">
    function saveDep(){
        var id=$("#hdId").val();
        var companyId=$("#companyList").val();
        var name=$("#depName").val();
        var remarks=$("#remark").val();

        if(name=='' || name==undefined){
            alert("部门名称不能为空");
        }

        $.post('/department/addDepartment',
        {name:name, remark:remarks, companyId:companyId},
        function (data) {
            if(data.code==1){
                alert("新增部门成功");
                window.location.href='/department/index';
            }else{
                alert(data.message);
            }
        });
    }
</script>